/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.i.kotionokyurievna.jewelry.domain.department;

import ua.i.kotionokyurievna.jewelry.domain.address.Address;
import ua.i.kotionokyurievna.jewelry.domain.employee.Employee;

/**
 *
 * @author Kateryna_Reznik
 */
public class Department {
    
    private int departmentId;
    private String departmentTitle;
    private Address address;
    private Employee manager;
    
    public Department(){
        
    }

    public Department(String departmentTitle, Address address, Employee manager) {
        this.departmentTitle = departmentTitle;
        this.address = address;
        this.manager = manager;
    }

    public Department(int departmentId, String departmentTitle, Address address, 
            Employee manager) {
        this.departmentId = departmentId;
        this.departmentTitle = departmentTitle;
        this.address = address;
        this.manager = manager;
    }

    public int getDepartmentId() {
        return departmentId;
    }

    public String getDepartmentTitle() {
        return departmentTitle;
    }

    public void setDepartmentTitle(String departmentTitle) {
        this.departmentTitle = departmentTitle;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public Employee getManager() {
        return manager;
    }

    public void setManager(Employee manager) {
        this.manager = manager;
    }
    
        

    @Override
    public String toString() {
        return "Department{" + "departmentId=" + departmentId + 
                ", departmentTitle=" + departmentTitle + ", address=" + 
                address + ", managerId=" + manager + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 37 * hash + (this.departmentTitle != null ? this.departmentTitle.hashCode() : 0);
        hash = 37 * hash + (this.address != null ? this.address.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Department other = (Department) obj;
        if ((this.departmentTitle == null) ? (other.departmentTitle != null) : !this.departmentTitle.equals(other.departmentTitle)) {
            return false;
        }
        if (this.address != other.address && (this.address == null || !this.address.equals(other.address))) {
            return false;
        }
        return true;
    }
    
    
    
}
